import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    num:0
  },
  getters: {
    num1(){
      return 666
    }
  },
  mutations: {
    JIA(state,value){
      this.state.num=state.num+value
    },
    ADD(state){
      state.num++
    },
    SUB(state){
      state.num--
    }
  },
  actions: {
    jia(context,value){
          context.commit('JIA',value)    
      },
      add(context){
        context.commit("ADD")
      },
      sub(context){
        context.commit('SUB')
      }
  },
  modules: {
  }
})
